$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/CPU} & (int $\rightarrow$ int) Map & VCPU to PCPU map \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/params} & (string $\rightarrow$ string) Map & The live equivalent to VM.VCPUs\_params \\
+$\mathit{RO}_\mathit{run}$ & {\tt state} & string Set & The state of the guest, eg blocked, dying etc \\
$\mathit{RO}_\mathit{run}$ & {\tt start\_time} & datetime & Time at which this VM was last booted \\
$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_state}
+
+{\bf Overview:}
+Get the state field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (string Set) get_state (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+string Set
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
#include "xen_common.h"
#include "xen_int_float_map.h"
#include "xen_int_int_map.h"
+#include "xen_string_set.h"
#include "xen_string_string_map.h"
#include "xen_vm_metrics_decl.h"
xen_int_float_map *vcpus_utilisation;
xen_int_int_map *vcpus_cpu;
xen_string_string_map *vcpus_params;
+ struct xen_string_set *state;
time_t start_time;
time_t last_updated;
} xen_vm_metrics_record;
xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
+/**
+ * Get the state field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics);
+
+
/**
* Get the start_time field of the given VM_metrics.
*/
{ .key = "VCPUs_params",
.type = &abstract_type_string_string_map,
.offset = offsetof(xen_vm_metrics_record, vcpus_params) },
+ { .key = "state",
+ .type = &abstract_type_string_set,
+ .offset = offsetof(xen_vm_metrics_record, state) },
{ .key = "start_time",
.type = &abstract_type_datetime,
.offset = offsetof(xen_vm_metrics_record, start_time) },
xen_int_float_map_free(record->vcpus_utilisation);
xen_int_int_map_free(record->vcpus_cpu);
xen_string_string_map_free(record->vcpus_params);
+ xen_string_set_free(record->state);
free(record);
}
}
+bool
+xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_state");
+ return session->ok;
+}
+
+
bool
xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics)
{